﻿@model Echegoyen.Models.Material

@{
    ViewBag.Title = "Nuevo Material";
}

<h2>Nuevo Material</h2>

@using (Html.BeginForm()) {
    @Html.AntiForgeryToken()
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>Material</legend>

        <div class="editor-label">
            @Html.LabelFor(model => model.Titulo)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Titulo)
            @Html.ValidationMessageFor(model => model.Titulo)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Editorial)
        </div>
        <div class="editor-field">
            @Html.DropDownListFor(model => model.EditorialId,
                (IEnumerable<SelectListItem>)@ViewBag.Editoriales)
            @Html.ValidationMessageFor(model => model.Editorial)        
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Tema)
        </div>
        <div class="editor-field">
            @Html.ListBoxFor(model => model.TemaId, (IEnumerable<SelectListItem>)ViewBag.Temas)
            @Html.ValidationMessageFor(model => model.Tema)        
        </div>
        
        <div class="editor-label">
            @Html.LabelFor(model => model.Autores)
        </div>
        <div class="editor-field">
            @Html.ListBoxFor(model => model.AutoresId, (IEnumerable<SelectListItem>)ViewBag.Autores)
            @Html.ValidationMessageFor(model => model.Autores)        
        </div>    

        <div class="editor-label">
            @Html.LabelFor(model => model.TipoMaterial)
        </div>
        <div class="editor-field">
            @Html.DropDownListFor(model => model.TipoMaterialId, 
                 (IEnumerable<SelectListItem>)@ViewBag.TiposMaterial)
            @Html.ValidationMessageFor(model => model.TipoMaterial)        
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.Sinopsis)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Sinopsis)
            @Html.ValidationMessageFor(model => model.Sinopsis)
        </div>

        <p>
            <input type="submit" value="Crear" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Volver", "Index")
</div>

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}
